package com.company.project.rest;

import com.company.project.constant.TradeEnums;
import com.company.project.protocol.coupon.ChangeCoponStatusReq;
import com.company.project.protocol.coupon.ChangeCoponStatusRes;
import com.company.project.protocol.coupon.QueryCouponReq;
import com.company.project.protocol.coupon.QueryCouponRes;
import com.company.project.protocol.goods.QueryGoodsReq;
import com.company.project.protocol.goods.QueryGoodsRes;
import com.company.project.protocol.goods.ReduceGoodsNumberReq;
import com.company.project.protocol.goods.ReduceGoodsNumberRes;
import com.company.project.web.TradeCouponController;
import com.company.project.web.TradeGoodsController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(value="优惠券服务")
@Component
@RestController
@RequestMapping("/trade/coupon")
public class CouponApi extends TradeCouponController {
    /**
     * 查询优惠券
     * @param queryCouponReq
     * @return
     */
    @Override
    @ApiOperation(value=" 查询优惠券",notes="根据 couponId 查询优惠券")
    @PostMapping("/queryCoupon")
    public QueryCouponRes queryCoupon( QueryCouponReq queryCouponReq) {
        return this.tradeCouponService.queryCoupon(queryCouponReq);
    }

    /**
     * 修改优惠券状态
     * @param changeCoponStatusReq
     * @return
     */
    @Override
    @ApiOperation(value=" 修改优惠券状态",notes="修改优惠券状态")
    @PostMapping("/changeCoponStatus")
    public ChangeCoponStatusRes changeCoponStatus( ChangeCoponStatusReq changeCoponStatusReq) {
        return  this.tradeCouponService.changeCoponStatus(changeCoponStatusReq);
    }
}
